cmake_minimum_required(VERSION 3.0.2)
project(stereo_camera)
set(CMAKE_CXX_STANDARD 11)

find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  image_transport
  roscpp
  rospy
  sensor_msgs
  std_msgs
  camera_info_manager
)

#set(OpenCV_DIR /home/hoyin/workspace/libopencv/opencv-3.4.5)
message(STATUS "OpenCV dir: $ENV{OpenCV_DIR}")

find_package(OpenCV 3.4.5 REQUIRED
        PATHS $ENV{OpenCV_DIR}
        NO_DEFAULT_PATH)

message(STATUS "OpenCV version: ${OpenCV_VERSION}")
message(STATUS "OpenCV install: ${OpenCV_INSTALL_PATH}")
message(STATUS "OpenCV include dirs: ${OpenCV_INCLUDE_DIRS}")
message(STATUS "OpenCV libs: ${OpenCV_LIBRARIES}")
message(STATUS "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}")


catkin_package(
#  INCLUDE_DIRS include
  LIBRARIES stereo_camera
  CATKIN_DEPENDS cv_bridge image_transport roscpp rospy sensor_msgs std_msgs
#  DEPENDS system_lib
)

include_directories(
# include
  ${OpenCV_INCLUDE_DIRS}
  ${catkin_INCLUDE_DIRS}
)

aux_source_directory(src/include INCLUDE_DIR)

add_executable(image_publisher src/image_publisher.cpp)
target_sources(image_publisher PUBLIC ${INCLUDE_DIR})

add_executable(composite_publisher src/composite_publisher.cpp)
target_sources(composite_publisher PUBLIC ${INCLUDE_DIR})

add_executable(unit_testing src/testing.cpp)
target_sources(unit_testing PUBLIC ${INCLUDE_DIR})



target_link_libraries(image_publisher ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
target_link_libraries(composite_publisher ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
target_link_libraries(unit_testing ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
